//1.注册路由
//2.使用app.use(router.routes())

import Router from 'koa-router'
import { findAllControllers,regRoute} from './utils.js';
//实例化一个路由对象
let router=new Router();
//找到所有的控制器文件
// let dir='../controllers'
let dir='controllers'
let controllers=findAllControllers(dir)
// console.log(controllers);

//注册路由
regRoute(router,controllers)
//导出路由
let route=router.routes();
export default route